<template>
	<view class="cover-container">
		<view class="custom-navbar" :style="{ height: navHeight + 'px', paddingTop: statusBarHeight + 'px' }">
			<view class="nav-left" @click="goBack">
				<image class="back-icon" src="/static/img/arrow-right.png"></image>
			</view>
		</view>
		<!-- <image class="fullscreen-image" @click="toTemp"
			src="https://pic.hedashepin.com/upload/3/20250516/d98920476f637146bb4517f508114667.jpg" mode="aspectFill">
		</image> -->
		<image class="fullscreen-image" @click="toTemp"
			src="https://pic.hedashepin.com/upload/3/20250519/7da4170979082a09c9509df0f248cef1.gif" mode="aspectFill">
		</image>
	</view>
</template>
<script>
	var app = getApp();
	export default {
		data() {
			return {
				navHeight: 44, // 导航栏内容高度（不包括状态栏）
				statusBarHeight: 20, // 状态栏高度
				menuButtonInfo: {}, // 胶囊按钮信息

			}
		},
		onLoad() {
			// this.getdata();
			// #ifndef H5 || APP-PLUS || MP-ALIPAY
			// 获取系统信息
			const systemInfo = uni.getSystemInfoSync()
			this.statusBarHeight = systemInfo.statusBarHeight || 20

			// 获取胶囊按钮信息（仅微信小程序）
			if (uni.getMenuButtonBoundingClientRect) {
				const menuButtonInfo = uni.getMenuButtonBoundingClientRect()
				this.menuButtonInfo = menuButtonInfo
				// 计算导航栏高度 = 状态栏高度 + 胶囊按钮高度 + (胶囊按钮上边距 - 状态栏高度) * 2
				this.navHeight = menuButtonInfo.bottom + (menuButtonInfo.top - this.statusBarHeight)
			} else {
				// 非微信小程序，使用默认高度
				this.navHeight = this.statusBarHeight + 44
			}
			// #endif
		},
		methods: {
			toTemp() {
				uni.navigateTo({
					url: '/pagesZone/temp/index'
				})
			},
			getdata: function() {
				var that = this;
				that.loading = true;
				app.get("My/usercenter", {}, function(data) {
					that.loading = false;


					that.loaded();
				});
			},
			goBack() {
				uni.navigateBack({
					delta: 1,
					fail: (err) => {
						// 如果返回失败(没有上一页)，则跳转到首页
						if (err.errMsg.includes("fail")) {
							uni.navigateTo({
								url: '/pages/my/usercenter'
							});
						}
					}
				})
			}
		}
	}
</script>
<style scoped>
	.cover-container {
		position: fixed;
		top: 0;
		left: 0;
		width: 100vw;
		height: 100vh;
		z-index: 999;
	}

	.fullscreen-image {
		width: 100%;
		height: 100%;
	}
	.custom-navbar {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
	
		display: flex;
		align-items: center;
		padding-left: 30rpx;
		padding-right: 30rpx;
		z-index: 999;
	
	}
	
	.nav-left {
		width: 60rpx;
	
	}
	
	.back-icon {
		width: 40rpx;
		height: 40rpx;
	}
	
</style>